package com.itheima.health.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 菜单
 */
@Table(name = "t_menu")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Menu implements Serializable{
    @Id
    private Integer id;
    private String name; // 菜单名称
    @Column(name = "linkUrl")
    private String linkUrl; // 访问路径
    private String path;//菜单项所对应的路由路径
    private Integer priority; // 优先级（用于排序）
    private String description; // 描述
    private String icon;//图标
    private Integer level;//菜单级别
    private Set<Role> roles = new HashSet<Role>(0);//角色集合
    private List<Menu> children = new ArrayList<>();//子菜单集合
    @Column(name = "parentMenuId")
    private Integer parentMenuId;//父菜单id

}
